;; core/seq.scm - (c) rohan drape, 2003-2005

;; Evaluate a sequence of expressions setting the value of the
;; variable `name' to the result of each expression before evaluating
;; the next.  The result is the value of `name'.  This is a common
;; idiom in signal processing graphs.  A variant binds `name' before
;; constructing the sequence.

(define-syntax seq
  (syntax-rules ()
    ((_ (name bind-to) expr ...)
     (let ((name bind-to)) (set! name expr) ... name))
    ((_ name expr ...)
     (begin (set! name expr) ... name))))

